//
//  UIButton+Extension.swift
//  weibopush
//
//  Created by 龚欣 on 15/7/1.
//  Copyright © 2015年 gong. All rights reserved.
//

import UIKit

extension UIButton{
    
    convenience init(title : String,color : UIColor,fontSize : CGFloat,imageName : String){
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(color, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
    }
    
    convenience init(title : String,fontSize : CGFloat,txtColor : UIColor = UIColor.whiteColor(),bgColor : UIColor = UIColor.brownColor() ){
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setTitleColor(txtColor, forState: UIControlState.Normal)
        backgroundColor = bgColor
    }
    
}